/* Copyright (C) 2008-2020 Allegro DVT2.  All rights reserved. */
/**************************************************************************//*!
   \addtogroup Buffers
   @{
   \file
 **************************************************************************/
#pragma once

//#define AL_ENC_MAX_SEI_SIZE (2 * 1024)
//#define AL_ENC_MAX_CONFIG_HEADER_SIZE (2 * 1024)
#define AL_ENC_MAX_SEI_SIZE (256)
#define AL_ENC_MAX_CONFIG_HEADER_SIZE (256)
#define AL_ENC_MAX_HEADER_SIZE (AL_ENC_MAX_CONFIG_HEADER_SIZE + AL_ENC_MAX_SEI_SIZE)

#include "lib_common/SliceConsts.h"

/*************************************************************************//*!
   \brief Retrieves the maximum size of one VCL NAL unit
   This returns the actual worst case a NAL unit could take.
   If you want the decoder bitstream buffer to always be able to hold a frame,
   you should use this function to allocate them as the decoder can't assume
   the possible worst case stream generated by the encoder which generated
   the stream. If you are in a controlled environment, you might want to look
   at AL_GetMitigatedMaxNalSize().
   \param[in] eCodec Codec
   \param[in] tDim Frame dimension
   \param[in] eMode Chroma subsampling
   \param[in] iBitDepth Bitdepth
   \param[in] iLevel Level
   \param[in] iProfileIdc Profile idc
   \return maximum size of one NAL unit
*****************************************************************************/
int AL_GetMaxNalSize(AL_ECodec eCodec, AL_TDimension tDim, AL_EChromaMode eMode, int iBitDepth, int iLevel, int iProfileIdc);

/*************************************************************************//*!
   \brief Retrieves the most likely to happen real worst case size of the encoder
   generated NAL unit.
   You should use this function to allocate the encoder bitstream buffers as
   it optimize the memory footprint.
   \param[in] tDim Frame dimension
   \param[in] eMode Chroma subsampling
   \param[in] iBitDepth Bitdepth
   \return maximum size of one NAL unit
*****************************************************************************/
int AL_GetMitigatedMaxNalSize(AL_TDimension tDim, AL_EChromaMode eMode, int iBitDepth);

/*@}*/

